import request from './index'
import { freeEnvConfig } from '@/config'

export const post = (url, { params, customConfig = {} }) => {
  return request({
    url,
    method: 'POST',
    data: params,
    ...customConfig,
  })
}

export const get = (url, { params, customConfig = {} }) => {
  return request({
    url,
    method: 'GET',
    params,
    ...customConfig,
  })
}

export const mockGet = (url, { params, customConfig = {} }) => {
  return request({
    url,
    method: 'GET',
    params,
    baseURL: freeEnvConfig.__MOCK_BASE_URL__,
    ...customConfig,
  })
}
